import 'package:healthy_station_flutter/generated/json/base/json_convert_content.dart';
import 'package:healthy_station_flutter/entity/pay_wait_entity.dart';
import '../../entity/drugs_entity.dart';


PayWaitEntity $PayWaitEntityFromJson(Map<String, dynamic> json) {
  final PayWaitEntity payWaitEntity = PayWaitEntity();
  final List<DrugsEntity>? prescriptions = (json['prescriptions'] as List<
      dynamic>?)?.map(
          (e) => jsonConvert.convert<DrugsEntity>(e) as DrugsEntity).toList();
  if (prescriptions != null) {
    payWaitEntity.prescriptions = prescriptions;
  }
  return payWaitEntity;
}

Map<String, dynamic> $PayWaitEntityToJson(PayWaitEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['prescriptions'] = entity.prescriptions?.map((v) => v.toJson()).toList();
  return data;
}

extension PayWaitEntityExtension on PayWaitEntity {
  PayWaitEntity copyWith({
    List<DrugsEntity>? prescriptions,
  }) {
    return PayWaitEntity()
      ..prescriptions = prescriptions ?? this.prescriptions;
  }
}